#ifndef SCENEBUILDER_H
#define SCENEBUILDER_H

class GraphicsScene;
class GraphicsItem;

class QUINCE_SCENE_EXPORT SceneBuilder
{
public:
    enum SelectionState
    {
        kUnselected,
        kSelected,
    };


    class ItemAttribute
    {
    public:
        ItemAttribute(GraphicsItem *p = nullptr, int z = 0, const QColor &c = QColor(255, 255, 255))
            : parent(p), zValue(z), color(c), visible(true), lineWidth(1.0f), selection(kUnselected)
        {}
        GraphicsItem *parent;
        int zValue;
        QColor color;
        bool visible;
        float lineWidth;
        SelectionState selection;
    };

    virtual ~SceneBuilder();
    virtual void reset() = 0;
    virtual void build(const ItemAttribute &param) = 0;
    virtual bool getItemAttribute(ItemAttribute &param) const = 0;
    virtual void removeItem() = 0;
    virtual void updateItem() = 0;
    virtual void setSelection(SelectionState select) = 0;
    virtual void setItemVisible(bool visible) = 0;
    virtual void setItemZValue(int zValue) = 0;
    virtual SelectionState selection() const = 0;

    GraphicsScene * scene() const { return m_scene; }
protected:
    explicit SceneBuilder(GraphicsScene &scene);

private:
    GraphicsScene *m_scene;
};

#endif // SCENEBUILDER_H
